package com.enjoyor.soa.traffic.rest.tsms.dubbo.impl;

import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.enjoyor.soa.traffic.api.dto.tsms.TaskExecuteRecordDto;
import com.enjoyor.soa.traffic.api.service.dubbo.tsms.IDubboTaskExecuteRecordService;
import com.enjoyor.soa.traffic.rest.tsms.dubbo.ITaskExecuteRecordConsumeService;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

@Component
public class TaskExecuteRecordConsumeService implements ITaskExecuteRecordConsumeService {

    @Reference(version = "1.0.0", timeout = 10000)
    //@Reference(version = "1.0.0", timeout = 10000, url="dubbo://192.168.56.8:21241")
    private IDubboTaskExecuteRecordService dubboTaskExecuteRecordService;
    
    /**
	 * 根据编号查询任务执行信息
	 * @param recordId 记录编号（不为空）
	 * @return
	 */
    @Override
	public ResultPojo getExecuteTaskRecordById(String recordId){
        return dubboTaskExecuteRecordService.getExecuteTaskRecordById(recordId);
    }

    @Override
	public ResultPojo getExecuteTaskRecordList(String recordId, String executeTaskId, String taskId, String recordTypeId,
			String isWarn, String beginTime, String endTime) {
    	return dubboTaskExecuteRecordService.getExecuteTaskRecordList(recordId, executeTaskId, taskId, recordTypeId, 
    			isWarn, beginTime, endTime);
    }
	
    @Override
	@SuppressWarnings("rawtypes")
	public ResultPojo getExecuteTaskRecordPage(Page page, String recordId, String executeTaskId, String taskId, 
			String recordTypeId, String isWarn, String beginTime, String endTime) {
    	return dubboTaskExecuteRecordService.getExecuteTaskRecordPage(page, recordId, executeTaskId, taskId, recordTypeId, 
    			isWarn, beginTime, endTime);
    }
    @Override
    public ResultPojo insertRecord(TaskExecuteRecordDto taskExecuteRecordDto, String personName) {
    	return dubboTaskExecuteRecordService.insertRecord(taskExecuteRecordDto, personName);
    }
}
